Skip to content

Add more APIC structure logs#5084

Open
CookieComputing wants to merge 1 commit intoproject-oak:mainfrom
CookieComputing:add-acpi-table-logs
Open

Add more APIC structure logs#5084
CookieComputing wants to merge 1 commit intoproject-oak:mainfrom
CookieComputing:add-acpi-table-logs

Conversation

@CookieComputing
Copy link
Contributor

Our CVMs happen to have a few extra APIC structs which would be greatly appreciated if we could get extra logs for. I've taken a look at the spec and added the struct implementations below. I've double checked the fields but let me know if I missed something!

I built this on our servers and ran it, got some of the following logs:

Before this PR

normal_structs.txt

The important logs to look at:

stage0 INFO:     Entry APIC - It is a MADT, Interrupt Controller Structures:
stage0 INFO:     -> Local APIC: ProcessorLocalApic { header: ControllerHeader { structure_type: 0, len: 8 }, processor_uid: 0, apic_id: 0, flags: LocalApicFlags(ENABLED) }
stage0 INFO:     -> Local APIC: ProcessorLocalApic { header: ControllerHeader { structure_type: 0, len: 8 }, processor_uid: 1, apic_id: 1, flags: LocalApicFlags(ENABLED) }
stage0 INFO:     -> Local APIC: ProcessorLocalApic { header: ControllerHeader { structure_type: 0, len: 8 }, processor_uid: 2, apic_id: 2, flags: LocalApicFlags(ENABLED) }
stage0 INFO:     -> Local APIC: ProcessorLocalApic { header: ControllerHeader { structure_type: 0, len: 8 }, processor_uid: 3, apic_id: 3, flags: LocalApicFlags(ENABLED) }
stage0 INFO:     -> Unknown structure, type = 1
stage0 INFO:     -> Unknown structure, type = 2
stage0 INFO:     -> Unknown structure, type = 2
stage0 INFO:     -> Unknown structure, type = 2
stage0 INFO:     -> Unknown structure, type = 2
stage0 INFO:     -> Unknown structure, type = 2
stage0 INFO:     -> Unknown structure, type = 4

After this PR

new_apic_structs.txt

The important logs to look at:

stage0 INFO:     Entry APIC - It is a MADT, Interrupt Controller Structures:
stage0 INFO:     -> Local APIC: ProcessorLocalApic { header: ControllerHeader { structure_type: 0, len: 8 }, processor_uid: 0, apic_id: 0, flags: LocalApicFlags(ENABLED) }
stage0 INFO:     -> Local APIC: ProcessorLocalApic { header: ControllerHeader { structure_type: 0, len: 8 }, processor_uid: 1, apic_id: 1, flags: LocalApicFlags(ENABLED) }
stage0 INFO:     -> Local APIC: ProcessorLocalApic { header: ControllerHeader { structure_type: 0, len: 8 }, processor_uid: 2, apic_id: 2, flags: LocalApicFlags(ENABLED) }
stage0 INFO:     -> Local APIC: ProcessorLocalApic { header: ControllerHeader { structure_type: 0, len: 8 }, processor_uid: 3, apic_id: 3, flags: LocalApicFlags(ENABLED) }
stage0 INFO:     -> I/O APIC: IoApic { header: ControllerHeader { structure_type: 1, len: 12 }, io_apic_id: 0, _reserved: 0, io_apic_addr: 4273995776, global_system_interrupt_base: 11003706212352 }
stage0 INFO:     -> Interrupt Source Override: InterruptSourceOverride { header: ControllerHeader { structure_type: 2, len: 10 }, bus: 0, source: 0, global_system_interrupt: 2, flags: 0 }
stage0 INFO:     -> Interrupt Source Override: InterruptSourceOverride { header: ControllerHeader { structure_type: 2, len: 10 }, bus: 0, source: 5, global_system_interrupt: 5, flags: 13 }
stage0 INFO:     -> Interrupt Source Override: InterruptSourceOverride { header: ControllerHeader { structure_type: 2, len: 10 }, bus: 0, source: 9, global_system_interrupt: 9, flags: 13 }
stage0 INFO:     -> Interrupt Source Override: InterruptSourceOverride { header: ControllerHeader { structure_type: 2, len: 10 }, bus: 0, source: 10, global_system_interrupt: 10, flags: 13 }
stage0 INFO:     -> Interrupt Source Override: InterruptSourceOverride { header: ControllerHeader { structure_type: 2, len: 10 }, bus: 0, source: 11, global_system_interrupt: 11, flags: 13 }
stage0 INFO:     -> Local APIC NMI: LocalApicNmi { header: ControllerHeader { structure_type: 4, len: 6 }, processor_uid: 255, flags: 0, local_apic_lint_num: 1 }

global_system_interrupt: u32,

/// See documentation for the various bits set.
flags: u16,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can probably add more detail here and define the flags here: https://github.com/project-oak/oak/blob/main/stage0/src/acpi_tables.rs#L645

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant